﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Win.DAL;
using Win.Model;
using Win.Common;
using Win.BLL;

namespace LoginFm
{
    public partial class Form2 : Form
    {
        UserBLL userBll = new UserBLL();

        public static Form2 f;
        public Form2()
        {
            InitializeComponent();
            f = this;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            String username = textBox1.Text.Trim();
            String passwd = Md5Helper.GetMd5(textBox2.Text);
            if (userBll.GetUser(username,passwd) != null)
            {
                //MessageBox.Show(Text = "登录成功");
                //Hide();
                Form1 form1 = new Form1();
                form1.Show();
                textBox1.Text = "";
                textBox2.Text = "";
            }
            else
            {
                MessageBox.Show(Text = "登录失败");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}
